package com.example.studentregistration.mapper;

import com.example.studentregistration.pojo.Clazz;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClazzMapper {

    int insertClazz(Clazz clazz);

    int updateClazz(Clazz clazz);

    int deleteClazz(@Param("id") Integer id);

    List<Clazz> queryAllClazz();

    Clazz queryClazzById(@Param("id") Integer id);

    /* 分页 + 模糊查询（可选） */
    List<Clazz> queryClazzByPage(@Param("grade") Integer grade,
                                 @Param("className") String className);

    /* 批量删除 */
    int batchDeleteClazz(@Param("ids") List<Integer> ids);

    Clazz queryClazzByClassName(@Param("className") String className);
}
